home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
lisp
/
kcl
/
akcl
/
akcl.lha
/
akcl
/
V
/
c
/
num_co.c
< prev
next >
Wrap
C/C++ Source or Header
|
1990-04-01
|
6KB
|
383 lines
Changes file for /usr/local/src/kcl/c/num_co.c
Created on Sun Apr 1 22:12:20 1990
Usage \n@s[Original text\n@s|Replacement Text\n@s]
See the file rascal.ics.utexas.edu:/usr2/ftp/merge.c
for a program to merge change files. Anything not between
"\n@s[" and "\n@s]" is a simply a comment.
This file was constructed using emacs and merge.el
Enhancements Copyright (c) W. Schelter All rights reserved.
by (Bill Schelter) wfs@carl.ma.utexas.edu
****Change:(orig (19 19 a))
@s[object plus_half, minus_half;
@s|object plus_half, minus_half;
#ifdef CONVEX
#define VAX
#endif
@s]
****Change:(orig (92 93 c))
@s[ h = *(int *)(&d);
l = *((int *)(&d) + 1);
@s| h = *((int *)(&d) + HIND);
l = *((int *)(&d) + LIND);
@s]
****Change:(orig (219 219 c))
@s[ return(((*(int *)(&d) & 0x7ff00000) >> 20) - 1022);
@s| return((((*((int *)(&d) + HIND)) & 0x7ff00000) >> 20) - 1022);
@s]
****Change:(orig (239 239 c))
@s[ return(0.0);
*(int *)(&d)
@s| return(0.0);
*((int *)(&d) + HIND)
@s]
****Change:(orig (250 250 c))
@s[ = *(int *)(&d) & 0x800fffff | ((e + 1022) << 20) & 0x7ff00000;
@s| = *((int *)(&d) + HIND) & 0x800fffff | ((e + 1022) << 20) & 0x7ff00000;
@s]
****Change:(orig (341 341 a))
@s[ vs_pop;
return(z);
}
@s| vs_pop;
return(z);
}
/* Coerce X to single-float if one arg,
otherwise coerce to same float type as second arg */
@s]
****Change:(orig (362 363 c))
@s[ if (narg > 1 && t == t_longfloat)
x = make_longfloat((double)(fix(x)));
@s| if (narg > 1 && t == t_shortfloat)
x = make_shortfloat((shortfloat)(fix(x)));
@s]
****Change:(orig (365 365 c))
@s[ x = make_shortfloat((shortfloat)(fix(x)));
@s| x = make_longfloat((double)(fix(x)));
@s]
****Change:(orig (371 372 c))
@s[ if (narg > 1 && t == t_longfloat)
x = make_longfloat(d);
@s| if (narg > 1 && t == t_shortfloat)
x = make_shortfloat((shortfloat)d);
@s]
****Change:(orig (374 374 c))
@s[ x = make_shortfloat((shortfloat)d);
@s| x = make_longfloat(d);
@s]
****Change:(orig (378 379 c))
@s[ if (narg > 1 && t == t_longfloat)
x = make_longfloat((double)(sf(x)));
@s| if (narg > 1 && t == t_shortfloat);
else
x = make_longfloat((double)(sf(x)));
@s]
****Change:(orig (521 521 c))
@s[ if (number_minusp(q1) && number_compare(q, q1)) {
@s| if (number_minusp(q) && number_compare(q, q1)) {
@s]
****Change:(orig (642 642 c))
@s[ if (number_plusp(q1) && number_compare(q, q1)) {
@s| if (number_plusp(q) && number_compare(q, q1)) {
@s]
****Change:(orig (1021 1021 c))
@s[ vs_base[0] = small_fixnum(6);
@s| vs_base[0] = small_fixnum(24);
@s]
****Change:(orig (1023 1023 c))
@s[ vs_base[0] = small_fixnum(14);
@s| vs_base[0] = small_fixnum(53);
@s]
****Change:(orig (1037 1037 c))
@s[ vs_base[0] = small_fixnum(6);
@s| vs_base[0] = small_fixnum(24);
@s]
****Change:(orig (1043 1043 c))
@s[ vs_base[0] = small_fixnum(14);
@s| vs_base[0] = small_fixnum(53);
@s]
****Change:(orig (1049 1049 c))
@s[ vs_base[0] = small_fixnum(13);
@s| vs_base[0] = small_fixnum(53);
@s]
****Change:(orig (1055 1055 c))
@s[ vs_base[0] = small_fixnum(14);
@s| vs_base[0] = small_fixnum(53);
@s]
****Change:(orig (1141 1141 a))
@s[ vs_base[0] = x->cmp.cmp_imag;
break;
}
}
@s| vs_base[0] = x->cmp.cmp_imag;
break;
}
}
static float sf1,sf2;
static sf_eql()
{return(sf1==sf2);}
static lf_eql(a,b)
double a,b;
{return(a==b);}
#define LF_EQL(a,b) lf_eql((double)(a),(double)(b))
#define SF_EQL(a,b) (sf1=a,sf2=b,sf_eql())
@s]
****Change:(orig (1157 1163 d))
@s[#ifdef IBMRT
#endif
@s,
@s|
@s]
****Change:(orig (1172 1176 c))
@s[ l[0] = 1;
smallest_float = *(float *)l;
l[0] = 0;
l[1] = 1;
@s, smallest_double = *(double *)l;
@s|
((int *) &smallest_float)[0]= 1;
((int *) &smallest_double)[HIND] = 0;
((int *) &smallest_double)[LIND] = 1;
@s]
****Change:(orig (1216 1220 c))
@s[ l[0] = 0x7f7fffff;
biggest_float = *(float *)l;
l[0] = 0x7fefffff;
l[1] = 0xffffffff;
@s, biggest_double = *(double *)l;
@s|
((int *) &biggest_float)[0]= 0x7f7fffff;
((int *) &biggest_double)[HIND] = 0x7fefffff;
((int *) &biggest_double)[LIND] = 0xffffffff;
#ifdef BAD_FPCHIP
/* &&&& I am adding junk values to get past debugging */
biggest_float = 1.0e37;
smallest_float = 1.0e-37;
biggest_double = 1.0e308;
smallest_double = 1.0e-308;
printf("\n Used fake values for float max and mins ");
@s]
****Change:(orig (1222 1222 a))
@s[#endif
#endif
@s|#endif
#endif
#endif
@s]
****Change:(orig (1277 1277 a))
@s[ biggest_double = *(double *)l;
#endif
@s| biggest_double = *(double *)l;
#endif
/* We want the smallest number not satisfying something,
and so we go quickly down, and then back up. We have
to use a function call for test, since in line code may keep
too much precision, while the usual lisp eql,is not
in line.
We use SMALL as a multiple to come back up by.
*/
#define SMALL 1.05
@s]
****Change:(orig (1279 1279 c))
@s[ (float)(1.0 + float_epsilon) != (float)1.0;
@s| !SF_EQL((float)(1.0 + float_epsilon),(float)1.0);
@s]
****Change:(orig (1281 1281 a))
@s[ float_epsilon /= 2.0)
;
@s| float_epsilon /= 2.0)
;
while(SF_EQL((float)(1.0 + float_epsilon),(float)1.0))
float_epsilon=float_epsilon*SMALL;
@s]
****Change:(orig (1283 1283 c))
@s[ (float)(1.0 - float_negative_epsilon) != (float)1.0;
@s| !SF_EQL((float)(1.0 - float_negative_epsilon) ,(float)1.0);
@s]
****Change:(orig (1285 1285 a))
@s[ float_negative_epsilon /= 2.0)
;
@s| float_negative_epsilon /= 2.0)
;
while(SF_EQL((float)(1.0 - float_negative_epsilon) ,(float)1.0))
float_negative_epsilon=float_negative_epsilon*SMALL;
@s]
****Change:(orig (1287 1287 c))
@s[ 1.0 + double_epsilon != 1.0;
@s| !(LF_EQL(1.0 + double_epsilon, 1.0));
@s]
****Change:(orig (1289 1289 a))
@s[ double_epsilon /= 2.0)
;
@s| double_epsilon /= 2.0)
;
while((LF_EQL(1.0 + double_epsilon, 1.0)))
double_epsilon=double_epsilon*SMALL;
;
@s]
****Change:(orig (1291 1291 c))
@s[ 1.0 - double_negative_epsilon != 1.0;
@s| !LF_EQL(1.0 - double_negative_epsilon , 1.0);
@s]
****Change:(orig (1293 1293 a))
@s[ double_negative_epsilon /= 2.0)
;
@s| double_negative_epsilon /= 2.0)
;
while(LF_EQL(1.0 - double_negative_epsilon , 1.0))
double_negative_epsilon=double_negative_epsilon*SMALL;
;
@s]